package com.qingke.memo.factory;

import com.qingke.memo.command.Command;
import com.qingke.memo.pojo.Memo;

public abstract class CommandFactory {
	public static enum CommandCode{
		//system
		ALTERCUSTOMTAG,
		ALTERMEMO,
		CREATECUSTOMTAG,
		CREATEMEMO,
		DELETECUSTOMTAG,
		DELETEMEMO,
		CONTENTKEY,
		CREATETIME,
		CUSTOMTAG,
		ID,
		TITLE,
		HELP,
		GOTOMEMO,
		//memo
		ALTERMEMOCUSTOMTAG,
		CREATEMEMOCUSTOMTAG,
		DELETEMEMOCUSTOMTAG,
		LEAVEMEMO
		
	}
	public static CommandFactory getFactory(Memo memo){
		if(memo==null)
			return new SystemCommandFactory();
		return new MemoCommandFactory(memo);
	}
	public abstract Command buildCommand(CommandCode cmdCode);
}
